package com.example.mqtt.domain

import lombok.Data
import lombok.ToString
import org.springframework.data.cassandra.core.cql.PrimaryKeyType
import org.springframework.data.cassandra.core.mapping.Column
import org.springframework.data.cassandra.core.mapping.PrimaryKeyColumn
import org.springframework.data.cassandra.core.mapping.Table
import java.io.Serializable
import java.util.*

@Data
@Table(value = "record_data")
@ToString
class RecordData : Serializable {

    companion object {
        var serialVersionUid: Long = 1
    }

    @PrimaryKeyColumn(name = "mcu_id", type = PrimaryKeyType.PARTITIONED, ordinal = 0)
     var mcuId: String? = null
    @PrimaryKeyColumn(name = "cycle_id", type = PrimaryKeyType.PARTITIONED, ordinal = 1)
    @Column(value = "cycle_id")
     var cycleId: Int? = null
    @PrimaryKeyColumn(name = "yhub_stime", ordinal = 1, type = PrimaryKeyType.CLUSTERED, ordering = org.springframework.data.cassandra.core.cql.Ordering.DESCENDING)
     var yhubStime: Int? = null//记录秒
    @Column(value = "yhub_mstime")
     var yhubMstime: Int? = null
    //记录shunt温度
    @Column(value = "shunt_temperature")
     var shuntTemperature: Int? = null
    //记录电池温度
    @Column(value = "battery_temperature")
     var batteryTemperature: Int? = null
    // 充电电流
    @Column(value = "current_charging")
     var currentCharging: Int? = null
    // 放电电流
    @Column(value = "current_using")
    var currentUsing: Int? = null
    @Column(value = "voltage_raw")
     var voltageRaw: Int? = null
    @Column(value = "soc")
     var soc: Int? = null
    //总已用ah
    @Column(value = "usedah")
     var usedah: Int? = null
    @Column(value = "chargedah")
     var chargedah: Int? = null
    @Column(value = "soh")
     var soh: Int? = null
    @Column(value = "soc_raw")
     var socRaw: Int? = null
    @Column(value = "create_time")
     var createTime: Date? = null

}